home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ada
/
c01oop.zip
/
ADAWKBK
/
SOL2-4.ADA
< prev
next >
Wrap
Text File
|
1992-08-25
|
613b
|
29 lines
-- Problem 2.4
-- by Rick Conn
with Text_IO;
procedure Main is
type String_Rec is record
S : STRING(1..80);
L : NATURAL; -- last index
end record;
SRA : array (1..5) of String_Rec;
begin -- Main
Text_IO.Put_Line ("Enter 5 strings:");
for I in 1 .. 5 loop
Text_IO.Put ("String " & NATURAL'IMAGE(I) & ": ");
Text_IO.Get_Line (SRA(I).S, SRA(I).L);
end loop;
for I in 1 .. 5 loop
Text_IO.Put ("Output String " & NATURAL'IMAGE(I) & ": ");
Text_IO.Put_Line (SRA(I).S (1 .. SRA(I).L));
-- output a slice of the string
end loop;
end Main;